﻿using System.Configuration;
using DataObjects.Interfaces;

namespace DataObjects
{
    // Factory Pattern
    public static class DataAccess
    {
        private static readonly string Connection = ConfigurationManager.AppSettings.Get("connection");
        private static readonly IDaoFactory Factory = DaoFactories.GetFactory(Connection);

        public static ICustomerDao CustomerDao
        {
            get { return Factory.CustomerDao; }
        }

        public static IOrderDao OrderDao
        {
            get { return Factory.OrderDao; }
        }
    }
}
